﻿using System;
using Application.Repositories;

namespace Application
{
    class MainWindowViewModelFactory : IMainWindowViewModelFactory
    {
        private readonly IRepository<Product> _productRepository;

        public MainWindowViewModelFactory(IRepository<Product> productRepository)
        {
            if (productRepository == null) throw new ArgumentNullException("productRepository");

            _productRepository = productRepository;
        }

        public MainWindowViewModel Create(IWindow window)
        {
            return new MainWindowViewModel(_productRepository, window);
        }
    }
}